import {Button, Form, Input, Icon, Row, Col, Modal} from 'antd';
import React, {Component} from 'react';

const FormItem = Form.Item;

//添加模板
class ButtonSubmit extends Component {
    constructor(props) {
        super(props);
        this.state = {
            text: '',
            title: '',
            className: '',
            modal2Visible: false,
        }
    };

    render() {
        return (
            <span>
                <Button style={{float: this.props.float}} type="primary"
                        onClick={(e) => this.props.click(e)}>{this.props.buttonText}</Button>
                <Modal
                    maskClosable={true}
                    title={this.props.title}
                    wrapClassName="vertical-center-modal"
                    width={this.props.width}
                    onOk={(e, id, type) => this.props.clickOk(e, id, type)}
                    visible={this.props.isVisible}
                    onCancel={(e) => this.props.clickCancel(e)}
                    confirmLoading={this.props.addConfirmLoading}
                    footer={[
                        <Button key="back" type='default' onClick={(e) => this.props.clickCancel(e)}>取消</Button>,
                        <Button key="submit" type='primary' onClick={(e, id, type) => this.props.clickOk(e, id, type)}>确定</Button>,
                    ]}
                >
                    {this.props.children}
                </Modal>
            </span>
        )
    }
}

export {
    ButtonSubmit
}